using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using MBMC.Paths;

namespace MBMC.Dialogs
{
    public partial class Interiors : Form
    {
        string mbfolder;
        bool GIMPExist;
        string tcpath;
        Paths.Paths p = new MBMC.Paths.Paths();
        public Interiors(string actualmbfolder, bool GIMPInstalled, string tqcpath)
        {
            InitializeComponent();
            mbfolder = actualmbfolder;
            GIMPExist = GIMPInstalled;
            tcpath = tqcpath;
        }

        private void Interiors_Load(object sender, EventArgs e)
        {
            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(p.Vrat_Cestu(mbfolder, MBPaths.FMDInteriors));
            foreach (System.IO.FileInfo file in di.GetFiles("*.dif"))
            {
                Console.WriteLine("{0}, {1}, {2}", file.Name, file.Length, file.Extension);
                listBox2.Items.Add(file.Name);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("You may choose beetwen Torque Constructor(free) and Quark(free), then export interior as .map file, and then Run MAP2DIF to make the .dif file.", "Mato Programs Help");
        }

        private void button7_Click(object sender, EventArgs e)
        {
            process1.Start();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            process2.Start();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            MBMC.Dialogs.RunMapDVADif mdvad = new RunMapDVADif();
            mdvad.ShowDialog();
        }

        private void button9_Click(object sender, EventArgs e)
        {
            try
            {
                process3.StartInfo.FileName = tcpath + "/Constructor.exe";
                process3.StartInfo.UseShellExecute = true;
                process3.Start();
            }
            catch
            {
                MessageBox.Show("Torque Constructor doesn't exist on selected path(" + tcpath + "). To set path run Marble Blast Mods Creator with install argument(MBMC.exe -install).", "Mato Programs", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

            }

        }
    }
}